export const baseUsage = `
//tree 数据结构
interface TreeNode{
    pid?:string|number
    id:string|number
    name:string
    checked?:boolean
    open?:boolean
    children?:TreeNode[]
}
interface Tree{
    'return-pid':{type:Boolean},    //是否返回父节点id，默认只返回叶子节点id
    nodes:{type:Object},    //可以是数组，对象，可以结构化或者扁平
    structured:{type:Boolean,default:true}, //数据是否结构化（已经有父子关系如TreeNode）
    checkable:{type:Boolean,default:false}, //开启多选
    values:{type:Array,default:()=>[]}  //默认选中的值 [TreeNode.id]

    @select 选中事件
}
`;
export const demo1 = `<ph-tree 
:nodes="tree1" 
:checkable="false" 
@select="onSelect1" 
:structured="false"></ph-tree>`;
export const demo2 = `<ph-tree 
:nodes="tree2" 
:checkable="true" 
@select="onSelect2"></ph-tree>`;
export const demo3 = `<ph-tree 
:nodes="tree2" 
:checkable="false" 
:return-pid="true" 
@select="onSelect2"></ph-tree>`;
export const testData = `

//测试数据
const testData={
    values:["1-1","1-2-1"],
    tree1:[{
        id:1,
        name:"海淀区"
    },{
        pid:1,
        id:"1-1",
        name:"知春路"
    },{
        pid:1,
        id:"1-2",
        name:"知春里"
    },{
        pid:1,
        id:"1-3",
        name:"上地"
    },{
        pid:"1-2",
        id:"1-2-1",
        name:"厕所"
    }],
    tree2:[{
        id:0,
        name:"北京市",
        children:[{
            pid:0,
            id:1,
            name:"海淀区",
            children:[{
                pid:1,
                id:"1-1",
                name:"知春路"
            },{
                pid:1,
                id:"1-2",
                name:"知春里"
            },{
                pid:1,
                id:"1-3",
                name:"上地"
            }]
        },{
            pid:0,
            id:2,
            name:"朝阳区",
            children:[{
                pid:2,
                id:"2-1",
                name:"望京"
            },{
                pid:2,
                id:"2-2",
                name:"望京西"
            }]
        }]
    },{
        id:9,
        name:"天津市",
        children:[{
                pid:9,
                id:"9-1",
                name:"望京"
            },{
                pid:9,
                id:"9-2",
                name:"望京西"
            }]
    }]
}`;
